<template>
	<view>
		<v-leaflet ref="bdleafletwx"></v-leaflet>
	</view>
</template>

<script>
	var L = require('../../wxcomponents/zhgeo/leafletwx')
	require('../../static/lib/bdmap/tileLayer.baidu')
	import {createMap} from '../../wxcomponents/zhgeo/base.map'
	import {DefaultIcons} from '../../wxcomponents/zhgeo/config.js';
	const defaultIcons = new DefaultIcons();
	
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			const container = this.$refs.bdleafletwx
			createMap(container, {
				crs: L.CRS.Baidu,
				minZoom: 3,
				maxZoom: 18,
				zoom: 18
			  }, function(map) {
			  L.tileLayer.baidu({ layer: 'vec' }).addTo(map),
			  map.setView([31.300635, 120.632314]);
			  
			  // 添加marker
			  let m = L.marker([31.300635, 120.632314], {
				src: defaultIcons.locationNow,
				width: 32,
				height: 32,
				showInCenter: false,
			  }).addTo(map);
			  // 删除marer
			  // map.removeLayer( m );
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
